package com.acme.task6;

public class CommentsRemover {
	public static void main(String[] args) {
		
		String str = "public class{\n"
				+ "this is like Java code \n"
				+ "/* Multiline\n"
				+ "comment \n*/"
				+ " some functions here too //comment to these functions\n"
				+ "//Comments\n"
				+ "}\n";
		
		String pattern = "//.*|(\"(?:\\\\[^\"]|\\\\\"|.)*?\")|(?s)/\\*.*?\\*/"; //CHEATING! :) http://evolvingweb.ca/sites/default/files/regular_expressions.png
		str = str.replaceAll(pattern, "");
		System.out.print(str);
	}
}
